<?php defined('SYSPATH') or die('No direct script access.');

class Date extends Kohana_Date {

    public static $timestamp_format = 'Y-m-d H:i:s';
    
    private static $_curTimestamp;
    
    public static function now(){
        if(!self::$_curTimestamp){
            self::$_curTimestamp = time();
        }
        return self::$_curTimestamp;
    }
    
    public static function nowStr($format=null){
        if(!$format){
            $format = self::$timestamp_format;
        }
        $result = date($format, self::now());
        return $result;
    }
    
    public static function datee($pattern, $time=null){
        if(!$time){
            $time = self::now();
        }
        
        $res = date($pattern, $time);
        
        
        
        return $res;
    }
    
}
